package tau.pimpmyfreedb.common.types;

public class TrackLength {
    int totalSeconds;

    public TrackLength(int totalSeconds) {
	this.totalSeconds = totalSeconds;
    }

    public TrackLength(int min, int sec) {
	this.totalSeconds = sec + (min * 60);
    }

    public int getMinutes() {
	return totalSeconds / 60;
    }

    public int getSeconds() {
	return totalSeconds % 60;
    }

    public int getTotalSeconds() {
	return totalSeconds;
    }

    public String toString() {
	return String.format("%02d:%02d", getMinutes(), getSeconds());
    }
}
